from django.contrib import admin
from .models import HostStatistics


@admin.register(HostStatistics)
class HostStatisticsAdmin(admin.ModelAdmin):
    list_display = ['stat_date', 'stat_type', 'city_name', 'data_center_name', 'total_hosts', 'online_hosts', 'offline_hosts', 'maintenance_hosts']
    list_filter = ['stat_date', 'stat_type', 'city_name', 'data_center_name']
    search_fields = ['city_name', 'data_center_name']
    readonly_fields = ['created_at']
    date_hierarchy = 'stat_date'
